<div class="bg-light lter b-b wrapper-md">
	<h1 class="m-n font-thin h3">
		<a id="head"></a>行政区域新增/修改
	</h1>
</div>
<div class="wrapper-md no-padder" ng-controller="sys_regionEditController">
	<div class="panel panel-default">
		<div class="panel-body">
			<form class="form-horizontal form-validation col-sm-11" method="get" name="form">
				<label class="col-sm-2 control-label">上级区域名称</label>
				<div class="col-sm-4 m-b-xs">
					<div class="input-group dropdown" uib-dropdown auto-close="outsideClick" dropdown-append-to-body="true">
						<ul app-ztree="setting" tree-hide-node="id" tree-obj="tree.ztree" class="ztree ztree-dropdown-menu dropdown-menu dropdown-menu-default col-sm-2" id="tree" tree-date="data" role="menu" uib-dropdown-menu ng-model="tree.obj"></ul>
						<input ng-model="tree.obj.name" class="form-control" readonly uib-dropdown-open>
						<div class="input-group-btn">
							<button type="button" class="btn btn-default dropdown-toggle" uib-dropdown-toggle>
								<span class="caret"></span><span class="sr-only"></span>
							</button>
						</div>
					</div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<label class="col-sm-2 control-label" >区域名称</label>
				<div class="col-sm-4">
					<input type="text" class="form-control m-b-xs" ng-model="entity.name" required >
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<label class="col-sm-2 control-label">区域代码</label>
				<div class="col-sm-4">
					<input type="text" name="code" class="form-control  m-b-xs" ng-model="entity.code" required ui-validate-async="{unique : 'unique($value)' }" >
                    <div class="bg-danger" ng-show="form.code.$invalid">
                        <div ng-show="form.code.$error.unique">区域代码已经存在，请重新输入。</div>
                    </div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<label class="col-sm-2 control-label">区域类型</label>
				<div class="col-sm-4 m-b-xs" default-value="'1'" app-dict-radio="entity.type" dict-type="sysAreaType"></div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<label class="col-sm-2 control-label">顺序</label>
				<div class="col-sm-4">
					<input type="text" class="form-control m-b-xs" ng-model="entity.sort" required >
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<label class="col-sm-2 control-label" >备注</label>
				<div class="col-sm-4">
					<textarea type="text" class="form-control  m-b-xs" ng-model="entity.remarks"></textarea>
				</div>

				<div class="line line-dashed b-b line-lg pull-in"></div>
				<div class="col-sm-5 col-sm-offset-2">
					<div class="m-b-md">
						<uib-alert ng-repeat="alert in Alert.alerts" type="{{alert.type}}" close="Alert.closeAlert($index)">
						{{alert.msg}} </uib-alert>
					</div>
					<!-- / alert -->
					<button type="submit" class="btn btn-default" ng-click="canle()">返回</button>
					<button type="submit" class="btn btn-primary" ng-disabled="form.$invalid || saveBtnDisable"
						ng-click="save(); saveBtnDisable = true;">保存</button>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
			</form>
		</div>
	</div>
</div>